package org.dromara.wms.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.tenant.core.TenantEntity;

import java.io.Serial;

/**
 * 产品分组对象 wms_group
 *
 * @author wenrui Su
 * @date 2024-04-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_group")
public class WmsGroup extends TenantEntity {

  @Serial
  private static final long serialVersionUID = 1L;

  @ExcelProperty(value = "id")
  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "产品名称")
  @NotBlank(message = "产品名称不能为空", groups = {AddGroup.class, EditGroup.class})
  private String name;

  @ExcelProperty(value = "编码")
  @NotBlank(message = "编码不能为空", groups = {AddGroup.class, EditGroup.class})
  private String spu;

  @ExcelProperty(value = "编码")
  private String attrValueName;

  @ExcelProperty(value = "是否商城商品", converter = ExcelDictConvert.class)
  @ExcelDictFormat(dictType = "sys_yes_no")
  private String isShop;

  @ExcelProperty(value = "是否销售模块", converter = ExcelDictConvert.class)
  @ExcelDictFormat(dictType = "sys_yes_no")
  private String isCrm;

  @ExcelProperty(value = "是否启用", converter = ExcelDictConvert.class)
  @ExcelDictFormat(dictType = "sys_status")
  @NotBlank(message = "是否启用不能为空", groups = {AddGroup.class, EditGroup.class})
  private String status;

  @ExcelProperty(value = "产品分类", converter = ExcelDictConvert.class)
  @ExcelDictFormat(dictType = "wms_product_tree")
  private String treeValue;

  @ExcelProperty(value = "商城分类")
  private Long mallMenuId;

  @ExcelProperty(value = "备注")
  private String remark;

}
